import paste.deploy

from xtreg.models import * 
from elixir import * 

def setup_config(command, filename, section, vars):
    """
    Place any commands to setup xtreg here.
    """
    conf = paste.deploy.appconfig('config:' + filename)
    conf.update(dict(app_conf=conf.local_conf, global_conf=conf.global_conf))
    paste.deploy.CONFIG.push_process_config(conf)

    tags_metadata.connect(conf['app_conf']['sqlalchemy.tags.dburi'])

    print "Creating db schema for xtreg..."
    tags_metadata.create_all()

    print "Populating data..."
    Tag('design')
    Tag('development')
    Tag('documentation')

    objectstore.flush()
    print "Done."
